package net.grandnature.android.morse.decode.example2;

import java.util.HashMap;
import java.util.Map;

public class MorseMapping {
	
	private static Map<String, String> mappingTable = new HashMap<String, String>();
	static {
		// TODO とりあえず英数字だけ
	    mappingTable.put("13", "A");
	    mappingTable.put("3111", "B");
	    mappingTable.put("3131", "C");
	    mappingTable.put("311", "D");
	    mappingTable.put("1", "E");
	    mappingTable.put("1131", "F");
	    mappingTable.put("331", "G");
	    mappingTable.put("1111", "H");
	    mappingTable.put("11", "I");
	    mappingTable.put("1333", "J");
	    mappingTable.put("313", "K");
	    mappingTable.put("1311", "L");
	    mappingTable.put("33", "M");
	    mappingTable.put("31", "N");
	    mappingTable.put("333", "O");
	    mappingTable.put("1331", "P");
	    mappingTable.put("3313", "Q");
	    mappingTable.put("131", "R");
	    mappingTable.put("111", "S");
	    mappingTable.put("3", "T");
	    mappingTable.put("113", "U");
	    mappingTable.put("1113", "V");
	    mappingTable.put("133", "W");
	    mappingTable.put("3113", "X");
	    mappingTable.put("3133", "Y");
	    mappingTable.put("3311", "Z");
	    mappingTable.put("33333", "0");
	    mappingTable.put("13333", "1");
	    mappingTable.put("11333", "2");
	    mappingTable.put("11133", "3");
	    mappingTable.put("11113", "4");
	    mappingTable.put("11111", "5");
	    mappingTable.put("31111", "6");
	    mappingTable.put("33111", "7");
	    mappingTable.put("33311", "8");
	    mappingTable.put("33331", "9");
	}
	public static String decodeSignalToChar(String s) {
		return mappingTable.get(s);
	}

}
